<?php $this->load->view('header') ?>

<!-- CONTENT -->
<div id="content">
<div class="column full">
		
		<div class="box">
		<div class="box-header">Setting Periode Baru</div>
		<div class="box-content box-table">
		<br />
		
		&nbsp;&nbsp;&nbsp;
        <?php echo isAccess('akuntansi','akunRincian','view') ? anchor('akuntansi/akunRincian/view', '<span class="icon_text preview"></span>Daftar Rincian Akun', 'class="button white"') : ''; ?>
        <br /><br />      
        
        	<?php if (isset($notification)) : ?>
            	<div class="notification error"><?php echo $notification; ?></div>
	        <?php endif; ?>
	        
            <?php if (isset($errorMessage)) : ?>
            	<div class="notification <?php echo ((isset($isSuccess) && $isSuccess) ? 'success' : 'error');?>"><?php echo $errorMessage; ?></div>
	        <?php endif; ?>    	
	        
	        <?php if (!(isset($isSuccess) && $isSuccess)) : ?>
            <?php  echo form_open('akuntansi/akunRincian/add/time/' . time(),array('name'=>'formAddAkunRincian','id'=>'formAddAkunRincian','class'=>'frModalLoad'),array('kirim'=>'kirim')); ?>
            
			<!-- Periode -->
			<table class="tablebox">
	        	<tr class='even'>
	        		<td width='50'><b>Periode</b></td>
	        		<td width='10'> : </td>
	        		<td><b><?php echo monthName(date('m')).' '.date('Y')?><b></td>
	        	</tr>
	        </table>
	        <br />
	        
            <!-- Akun -->
            <table class="tablebox">
	            <thead class="table-header" style="border-top:1px solid #ccc;border-bottom:1px solid #ccc">
	                <tr>
	                	<th width="10">No</th>
	                    <th>Tipe</th>
	                    <th>Kode</th>
	                    <th>Nama</th>
	                    <th>Saldo Baru</th>
	                    <th width='200'>Saldo Lama</th>
	                </tr>
	            </thead>
	            <tbody>
            	<?php $no=1;?>
                <?php if($listAkun) foreach($listAkun as $key=>$row):?>
                <?php $class = $no % 2 == 0 ? 'even' : 'odd' ?>
                <tr class=<?php echo $class?>>
                    <td><?php echo $no?></td>
                	
                	<!-- Tipe -->
                	<td>
                	<?php if($key > 0):?>
                		<?php echo $listAkun[$key-1]['akunTipeNama'] == $row['akunTipeNama'] ? '' : $row['akunTipeNama'];?>
                	<?php else:?>
                    	<?php echo $row['akunTipeNama'];?>
                    <?php endif;?>
                    </td>
                    
                    <td><?php echo get_data($row,'akunKode')?></td>
                    <td><?php echo get_data($row,'akunNama')?></td>
                    
                    <td>
                        <br /><?php echo form_input(array('name'=>'akunSaldo['.$row['akunId'].']','value'=>isset($_POST['akunSaldo'][$row['akunId']]) ? $_POST['akunRealisasi'][$row['akunId']] : 0, 'class'=> 'form-field width60'));?>
                    </td>
                    <td>
                        <br />
                        <?php if( isset($dataView[$key]['akunSaldo']) ):?>
                    		Rp. <span style="float:right;"><?php echo number_format($dataView[$key]['akunSaldo']);?></span>
                    	<?php else:?>
                    		-
                    	<?php endif?>
                    </td>

                </tr>
                <?php $no++;?>
				<?php endforeach;?>    
				</tbody>
				<tfoot>
                <tr>
                	<td></td><td></td><td></td><td></td>
                    <td>
                        <br /><?php echo form_submit('submit','Simpan', 'class="button themed"');?>
                    </td>
                </tr>
                </tfoot>
            </tbody>            
            </table>
            <br /><br />
            
            </form>
            <br />
			<?php endif;?>
			
          </div>
        </div>
      </div>
      <!-- End Widget-->
      
      <div class="clear"></div>
    </div>
  </div>

<script src="<?php echo base_url();?>js/libs/jquery/mod/web/jquery.format-price.js" type="text/javascript"></script>
<script src="<?php echo base_url();?>js/libs/jquery/mod/web/jquery.alphanumeric.pack.js" type="text/javascript"></script>  
<script type="text/javascript">
<!--
jQuery(document).ready(function($){
	//Numeric
	$('.form-field').priceFormat({
	    prefix: '',
	    thousandsSeparator: ',',
	    centsSeparator: '',
	    centsLimit: 0
	});

});
//-->
</script>
<?php $this->load->view('footer') ?>